Skip to contentSkip to conversation

adding a system call in uml

uml-devel Mohammad Jawwad 2 participants 2 messages Feb 3, 2007 – Feb 6, 2007 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Hello,

How does one add a system call to user mode linux?

I followed the instructions here:=

http://user-mode-linux.sourceforge.net/lksct/

Instead of using his stub(which dosent work) I used this one:

#include <stdio.h>

#include <sys/syscall.h>

#include <linux/unistd.h>

int main()

{

syscall(253); // I assigned number 253 to my system call in unistd.h

return 0;

}

The program compiles but dosent print out the the output from the printk() statement.

Has anybody successfully installed a system call in uml?

Thank you

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 9 lines · Mohammad Jawwad

Hello,

How does one add a system call to user mode linux?

I followed the instructions here:=

http://user-mode-linux.sourceforge.net/lksct/

It's from 2002, (I've seen this in the homepage), it's outdated. No information about kernel development lasts for so long.

Those instructions could be meaningful for 2.4, and _maybe_ early 2.6 UML kernels (I didn't look at the details).
Which UML version did you use?

These days, to add a syscall to a 32bit UML you must patch x86 sources, and for a 64bit UML, the x86-64 sources. There will be more info on doing that in various websites.So look for info on doing that.

Files to modify are, at least:
For x86:
include/asm-i386/unistd.h
arch/i386/kernel/syscall_table.S

For x86_64:
include/asm-x86_64/unistd.h

Those files are included/reused by UML - this was done to make it easier to keep syscall tables in sync.

Also, syscall 253 is already assigned these days.

Quoted 4 lines

The program compiles but dosent print out the the output from the printk() statement.

Has anybody successfully installed a system call in uml?

Signature · 16 lines
Inform me of my mistakes, so I can add them to my list!
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel